#ifndef __ESP8266_DEVICE_H__
#define __ESP8266_DEVICE_H__

#include "main.h"

#define iTimeout    1000
#define SSID        "YXS1005-1"
#define PASSWORD    "yuanxueshe1005"

#define REMOTEIP    "192.168.1.9"
#define REMOTEPORT  "8888"

#define ESP8266PORT "6060"

#define INFOSIZE 200

typedef struct NetTime
{
    char year[5];
    char month[4];
    char day[4];
    char hour[3];
    char min[3];
    char sec[3];
    char week[4];
}NetTime, *pNetTime;


typedef struct netdevice
{
    char *name;
    char ipaddr[32];
    int (*Init)(struct netdevice *pDev);
    int (*Connect)(struct netdevice *pDev);
    int (*GetInfo)(struct netdevice *pDev, char *esp8266StaIp);
    int (*Close)(struct netdevice *pDev);
    int (*Transfer)(struct netdevice *pDev);
    int (*GetNetTime)(struct netdevice *pDev, pNetTime time);
	int (*Recv)(struct netdevice *pDev, char *data, int *pLen, int iTimeoutMS);
}netDevice, *pNetDevice;

pNetDevice GetNetDev(char *name);

#endif
